package com.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mapper.PostImgMapper;
import com.bean.PostImg;
import com.service.PostImgService;
@Service
public class PostImgServiceImpl extends ServiceImpl<PostImgMapper, PostImg> implements PostImgService{

    @Autowired
    PostImgMapper postImgMapper;

    @Override
    public List<PostImg> selectAllPostImgsByPostId(int postId) {

        Map<String, Object> map = new HashMap<>();
        map.put("post_id", postId);

        return postImgMapper.selectByMap(map);
    }

    @Override
    public int insertPostImg(PostImg postImg) {
        return postImgMapper.insert(postImg);
    }
}
